package com.adtech.adms.commons.web.action;

import java.util.List;

import com.adtech.core.dao.query.FilterMap;
import com.adtech.core.dao.query.Pager;
import com.adtech.core.dao.query.Sort;

/**
 * 
 * 分页的主要方法
 * @author 杜凯 
 * @since 2011-3-21 
 * 
 * @Copyright (C) AD Tech Workshop All Right Reserved
 */
public abstract class TreeGridAction extends DataGridAction {

	/**
	 * @function
	 * @param
	 *
	 * @return
	 * @exception
	 *
	 * @author
	 * @history
	 *
	 */
	private static final long serialVersionUID = 4704707949064640831L;
	private List<Object> resultNodes;
	public List<Object> getResultNodes() {
		return resultNodes;
	}
	public void setResultNodes(List<Object> resultNodes) {
		this.resultNodes = resultNodes;
	}

	/**
	 * 
	 * @function 执行Ajax查询并将查询结果以json方式返回
	 * @param
	 * 
	 * @return 跳转结果
	 * @exception
	 * 
	 * @author Dormin
	 * @history
	 * 
	 */
	public String ajaxLoadNodes() {

		resultNodes = getModelTreeGridNodes(getFilterMap(),getSorter() );

		return SUCCESS;

	}

	protected abstract List getModelTreeGridNodes(FilterMap filtermap, Sort sort);
	protected abstract List getModelTreeGridRoots(Pager pager, FilterMap filtermap, Sort sort);

	@Override
	protected  List getModelDataGridList(Pager pager, FilterMap filtermap, Sort sort) {

		return getModelTreeGridRoots( pager,  filtermap,  sort);
	}

}
